<include file="Public:header" />
<div class="page-member subpage">
    <div class="form-header">
        <div>
            <div class="line1">
                <div class="fl"><h3>租金统计报表</h3></div>
                <div class="fr">

                </div>
            </div>
            <div class="line2">
                <!-- 编辑按钮组 -->
                <div class="fl form-btn-group btn-group-edit">
                    <button onclick="action_export()" class="btn-save btn-highlight">导 出</button>
                    <span>或</span>
                    <a onclick="history.back(-1);" class="linkBtn btn-abort" href="javascript:void(0);">返回</a>
                </div>
                <!-- 保存按钮组 -->
                <div class="fl form-btn-group btn-group-save hidden">
                    <button onclick="action_save();" class="btn-save btn-highlight">保 存</button>
                    <span>或</span>
                    <a class="linkBtn btn-abort" onclick="action_abort();" href="javascript:void(0);">放弃</a>
                </div>
                <div class="fr" style="margin-right:100px;">
                    <form class="search-form" method="post" action="">
                        <label style="padding:0 5px;">统计时段</label>
                        <select name="year">
                            <volist name="years" id="vo" key="index">
                                <if condition="$vo eq $year">
                                    <option selected="selected" value="{$vo}">{$vo}年</option>
                                <else />
                                    <option value="{$vo}">{$vo}年</option>
                                </if>
                            </volist>
                            <option value="all">所有年份</option>
                        </select>

                        <button class="btn-normal" type="submit">查 询</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="form-box2">
        <div style="border-bottom:0;padding:15px 0 0 0;">
            <table class="form-report" style="margin:0 auto;border-top:2px solid #000 !important;border-bottom:2px solid #000;">
                <thead>
                <tr>
                    <th width="25%">统计小区</th>
                    <th width="25%">租金缴纳户数</th>
                    <th width="25%">出租房源面积</th>
                    <td>租金收缴金额</td>
                </tr>
                </thead>
                <tbody>
                <volist name="rental" id="vo">
                    <tr>
                        <th>
                            <a href="/admin/payments/index?field=community&value={$vo.name}">
                                {$vo.name}
                            </a>
                        </th>
                        <th>{$vo.num}</th>
                        <th>{$vo.size}</th>
                        <th>{$vo.total}</th>
                    </tr>
                </volist>
                </tbody>
                <tfoot>
                    <tr>
                        <th>总计：</th>
                        <th>{$total['num']}</th>
                        <th>{$total['size']}</th>
                        <th>{$total['total']}</th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>
<script>
    function action_export(){
        var year = $("select[name=year]").val();
        location.href='/admin/reportRental/ajax_export?year='+year;

    }
</script>
<include file="Public:footer" />
